#ifndef LINUXRENDERSYSTEM_H
#define LINUXRENDERSYSTEM_H
#include "stomped_reality/render_system/RenderSystem.h" // Base class: stomped_reality::render_system::RenderSystem
#include <GL/glx.h>
#include <X11/Xlib.h>
namespace StompedReality
{
namespace Graphics
{
class DLL_EXPORT LinuxRenderSystem : public StompedReality::Graphics::RenderSystem
{
 private:

  Display* dpy;
  Window root;
  XVisualInfo* vi;
  Colormap cmap;
  XSetWindowAttributes swa;
  Window win;
  GLXContext glc;
  XWindowAttributes gwa;
  XEvent xev;

 public:

  //! \brief	Constructor.
  LinuxRenderSystem( );

  //! \brief	Destructor.
  virtual ~LinuxRenderSystem( );
  void* GetDisplayPointer( ) {
    return this->dpy;
  }

  /*!
   * \brief		Creates a new windows.
   *
   * \param		width	The width of the render context.
   * \param		height	The height of the render context
   * \param		fullscreen	Is fullscreen.
   * \param		title	The windows title.
   *
   * \return	True if success otherwise false.
   */
  bool InitWindow ( int width, int height, bool fullscreen, const char* title );

  /*!
   * \brief		Closes the window.
   *
   * \return	True if success otherwise false.
   */
  bool CloseWindow( );

  /*!
   * \brief		Initializes the OpneGL extensions.
   *
   * \return	True if success otherwise false
   */
  bool InitGLExtensions( );

  /*!
   * \brief		Tests if the window is open.
   *
   * \return	True if open otherwise false.
   */
  bool IsWindowOpen( );
  void SwapBuffer ( );
};

}
}
#endif // ifndef LINUXRENDERSYSTEM_H